export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
export TC_INSTALL_DIR=/home/terracotta/terracotta/terracotta-3.4.0

if ps ax | grep -v grep | grep start-tc-server.sh > /dev/null
then
        echo "Terracotta Server is already running"
else
        $TC_INSTALL_DIR/bin/start-tc-server.sh -f /home/terracotta/zahra/soap-tc-config.xml &
fi


if ps ax | grep -v grep | grep zahra.jar > /dev/null
then

echo "Zahra SOAP is already running"

else

$JAVA_HOME/bin/java -Xms3G -Xmx3G -cp zahra/zahra.jar:\
zahra/lib/commons-codec-1.4.jar:\
$TC_INSTALL_DIR/common/terracotta-toolkit-1.1-runtime-2.0.0.jar \
com.google.zahra.soap.Server &

fi

